package com.caikun.services;

import java.util.List;

import org.njbdqn.ali.database.PageHelper;

import com.caikun.dao.UserinfosDao;
import com.caikun.entity.Userinfos;


public class UserinfosService {
	private UserinfosDao udao;
	
	public UserinfosService(){
		udao =new UserinfosDao();
	}
	public int save(Userinfos user){
		return udao.save(user);
	}

	public int delete(int account){
		return udao.delete(account);
	}
	public int update(Userinfos user){
		return udao.modify(user);
	}
	
	public PageHelper getPage(int page){
		return udao.findPage(page, 5);
	}
	public List TeltoPassword(String bind){
		return udao.TeltoPassword(bind);
	}
	public int TelUpdatePassword(String password,String bind){
		return udao.TelUpdatePassword(password,bind);
	}
	public List<Userinfos> findLogin(String bind,String password){
		return udao.findLogin(bind,password);
	}
	
	public List findByNickname(String bind,String nickname){
		return udao.findByNickname(bind, nickname);
	}
	public int modifyNickname(String nickname,String bind){
		return udao.modifyNickname(nickname,bind);
	}

	public List findByID(int account){
		return udao.findByID(account);
	}
	public List<Userinfos>findregister(String bind){
		return udao.findregister(bind);
	}
	
	public List<Userinfos>findUserByBind(String bind){
		return udao.findUserByBind(bind);
	}
	public List findBypassword(int account){
		return udao.findBypassword(account);
	}
	public int modifyPassword(int account, String oldPassword, String newPassword){
		return udao.modifyPassword(account, oldPassword, newPassword);
	}
}